﻿Public Class Form1
  Private Sub MonthCalendar1_DateChanged(
      ByVal sender As System.Object,
      ByVal e As System.Windows.Forms.DateRangeEventArgs) _
      Handles MonthCalendar1.DateChanged
    Dim inizio As DateTime
    Dim fine As DateTime
    inizio =
       Me.MonthCalendar1.SelectionRange.Start
    fine =
       Me.MonthCalendar1.SelectionRange.End
    If inizio.Equals(fine) Then
      Me.TextBox1.Text = "Data " &
          fine.ToString("dd/MM/yyyy")
    Else
      Me.TextBox1.Text = "Periodo dal " &
          inizio.ToString("dd/MM/yyyy") &
          " al " &
          fine.ToString("dd/MM/yyyy")
    End If
  End Sub
End Class
